package com.zhsm.fuxi.mvp.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.zhsm.fuxi.R
import com.zhsm.fuxi.bean.InvoiceDetailResp
import com.zhsm.fuxi.utils.TimeUtils


/**
 * Created by GuZhC on 2018/11/7.
 * describe:
 */
class InvoiceHistoryRecyclerAdapter(data: List<InvoiceDetailResp>) : BaseQuickAdapter<InvoiceDetailResp, BaseViewHolder>(R.layout.layout_history_invoice, data) {
    override fun convert(helper: BaseViewHolder, data: InvoiceDetailResp) {

        val startTime = TimeUtils.getTime(data.createTime!!, TimeUtils.DATE_SIMPLE_DATA)
        helper.setText(R.id.invoiceHstMoney, "¥${data.invoiceAmount}")

        helper.setText(R.id.invoiceHstTime, startTime )
        if (data.invoiceType == 2) helper.setText(R.id.invoiceHstStart, "企业单位")
        else helper.setText(R.id.invoiceHstStart, "个人")
        helper.setText(R.id.invoiceHistoryState, "已开票")

    }
}